#include<iostream>
#include"my_binary_tree.h"
using namespace std;

void construct_test(vector<int>& v){
	int height=3;
	int sum=pow(2,height)-1;
	for(int i=0;i<sum;i++){
		v.push_back(i);
	}	
}

void construct_test2(vector<int>& v){
	v.push_back(4);
	v.push_back(2);
	v.push_back(6);
	v.push_back(1);
	v.push_back(3);
	v.push_back(5);
	v.push_back(7);	
}

int main(){
	cout<<"test:construct_binary_tree"<<endl;
	my_binary_tree<int> bt1(0);
	vector<int> v;
	construct_test2(v);
	my_binary_tree<int>* p=bt1.construct_full_binary_tree(v,0);
//	p->traversal_binary_tree("layer_first",print);
	cout<<(*p); 
	cout<<endl;
	cout<<"test:get_h_layers_nodes"<<endl;
	cout<<(*p).get_h_layer_nodes(1)<<endl;
	cout<<(*p).get_h_layer_nodes(2)<<endl;
	cout<<(*p).get_h_layer_nodes(3)<<endl;
//	cout<<(*p).get_h_layer_nodes(4)<<endl;
	cout<<"test:is_binary_sear_tree"<<endl;
	cout<<(*p).is_binary_search_tree()<<endl;
	cout<<"test:="<<endl;
	my_binary_tree<int> q=*p;
	cout<<"test:mirror"<<endl;
	q.mirror();
	cout<<q<<endl;
	cout<<"test:copy"<<endl;
	bt1.copy(&q,p);
	cout<<q<<endl;
	cout<<"test:get_value"<<endl;
	p->get_value();
	cout<<"test:find"<<endl;
	my_binary_tree<int>* find_val=p->find(6);
	find_val->get_value();
	return 0;
}
    
